package com.agp.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;


/**
 * 用户登录
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserRegisterDTO {
    // 手机号
    @NotBlank(message = "手机号不能为null、空字符串和空白串")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式错误")
    @ApiModelProperty("手机号")
    private String phone;
    // 密码
    @ApiModelProperty("密码")
    @Size(min = 6, max = 20, message = "密码长度在6-20之间")
    private String password;

    // 确认密码
    @ApiModelProperty("确认密码")
    @Size(min = 6, max = 20, message = "密码长度在6-20之间")
    private String confirmPassword;

    // 验证码
    @ApiModelProperty("验证码")
    @Size(min = 6, max = 6, message = "验证码长度为6")
    private String captcha;

    @ApiModelProperty(value="昵称", required = false)
    private String nickname;

}
